﻿using System;
using System.ComponentModel.DataAnnotations.Schema;

namespace HiSport.Core.Entities.Auditing
{
    /// <summary>
    /// 创建（聚合）
    /// </summary>
    [Serializable]
    public abstract class CreationAuditedAggregateRoot : CreationAuditedAggregateRoot<long>
    {
        
    }

    /// <summary>
    ///创建（聚合）
    /// </summary>
    /// <typeparam name="TPrimaryKey">Type of the primary key of the entity</typeparam>
    [Serializable]
    public abstract class CreationAuditedAggregateRoot<TPrimaryKey> :  ICreationAudited
    {
        /// <summary>
        /// 创建人
        /// </summary>
        public string CreatedBy { get ; set ; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedTime { get ; set ; }

        /// <summary>
        /// Constructor.
        /// </summary>
        protected CreationAuditedAggregateRoot()
        {
            CreatedTime =DateTime.Now;
        }
    }
}
